import request from '@/utils/request'

// 获取支付记录列表
export function getPaymentRecords(params) {
  return request({
    url: '/v1/admin/payments',
    method: 'get',
    params
  })
}

// 获取支付记录详情
export function getPaymentDetail(id) {
  return request({
    url: `/v1/admin/payments/${id}`,
    method: 'get'
  })
}

// 生成支付二维码
export function generatePaymentQR(orderId, data) {
  return request({
    url: `/v1/admin/orders/${orderId}/payment`,
    method: 'post',
    data
  })
}

// 支付配置管理API
export function getPaymentConfigs() {
  return request({
    url: '/v1/admin/payment-configs',
    method: 'get'
  })
}

export function createPaymentConfig(data) {
  return request({
    url: '/v1/admin/payment-configs',
    method: 'post',
    data
  })
}

export function updatePaymentConfig(id, data) {
  return request({
    url: `/v1/admin/payment-configs/${id}`,
    method: 'put',
    data
  })
}

export function deletePaymentConfig(id) {
  return request({
    url: `/v1/admin/payment-configs/${id}`,
    method: 'delete'
  })
}

// 获取支付统计
export function getPaymentStatistics(params) {
  return request({
    url: '/v1/admin/payments/statistics',
    method: 'get',
    params
  })
} 